<?php
try{
$client = new SoapClient( "http://cmeclient.is.marist.edu/ESSearchServer/wsdl/com/ibm/es/ws6/server/search/ofsearch.wsdl");
$client->__setLocation("http://cmeclient.is.marist.edu/ESSearchServer/services/ofsearchBinding");
$parameters = array( "ID"=>"FDR","password"=>"","token"=>"");
$response = $client->getAvailableFields($parameters);
foreach($response->fields as $field){
	$tmp[] = $field->iD;
}
//print_r($tmp);
							//'queryText'=>$_GET['q']+'camel',

$parameters = array('collectionIDs'=>array(),
							'applicationInfo'=>array("ID"=>"FDR","password"=>"","token"=>""),
							'linguisticMode'=>FALSE,
							'queryText'=>'training%',
							'predefinedResultsEnabled'=>FALSE,
							'firstRequestedResult'=>0,
							'resultCategoriesDetailLevel'=>1,
							'sortOrder'=>1,
							'sortPoolSize'=>500,
							'synonymExpansionMode'=>0,
							'spellCorrectionEnabled'=>TRUE,
							'siteCollapsingEnabled'=>FALSE,
							'returnedFields'=>array("item"=>array('name' => 'Local_Number'),"item"=>array('name'=>'returnFields')),
							'properties'=>array("FuzzyNGramSearch" => TRUE, ),
							'sortKeyByLocale'=>array('key'=>'score','locale'=>array('language'=>'en','country'=>'US')),
							'returnAttribute'=>array('item'=>array('name'=>'Local_Number')),
							'clientLocale'=>array('language'=>'en','country'=>'US'),
							'numRequestedResults'=>1);
							//'sortKeyByLocale'=>array('key'=>'title','locale'=>array('language'=>'en','country'=>'US')),
							//'returnedFields'=>array('item'=>array('name' => 'title',),'item'=>array('name'=>'box')),
$response = $client->search($parameters);
print_r($response);

}
catch(SoapFault $e){
	print_r($e);
}
